import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// import vueDevTools from "vite-plugin-vue-devtools";
import basicSsl from "@vitejs/plugin-basic-ssl";

// https://vite.dev/config/
export default defineConfig({
  base: "./",
  build: {
    target: "es2015",
  },
  plugins: [vue(), basicSsl()],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
  server: {
    host: "0.0.0.0",
    https: true,
    proxy: {
      "/app-api": {
        target: "http://120.24.179.27:48080", // 后端服务的地址
        changeOrigin: true, // 是否改变源
      },
    },
  },
});
